<template>
  <div class="app-container">
    <el-card class="box-card">
      <el-form ref="form" :model="form">
        <el-descriptions title="承制单位信息" style="text-align: center" :column="3" border>

          <el-descriptions-item label="单位名称" :span="1" label-class-name="my-label" :labelStyle="labelStyle">
            {{ form.departmentName }}
          </el-descriptions-item>

          <el-descriptions-item label="统一社会信用代码" :span="1" label-class-name="my-label" :labelStyle="labelStyle">
            {{ form.creditCodes }}
          </el-descriptions-item>

          <el-descriptions-item label="监管JDS" :span="1" label-class-name="my-label" :labelStyle="labelStyle">
            <dict-tag :options="dict.type.yh_representative_office" :value="form.representativeOffice" style = "float:left;"/>
          </el-descriptions-item>

          <el-descriptions-item label="菜单" :span="1" label-class-name="my-label" :labelStyle="labelStyle">
            <dict-tag :options="dict.type.yh_menus" :value="form.menus" style = "float:left;"/>
          </el-descriptions-item>

          <el-descriptions-item label="地址" :span="1" label-class-name="my-label" :labelStyle="labelStyle">
            {{ form.address }}
          </el-descriptions-item>

          <el-descriptions-item label="KJ主业务分公司地址" :span="1" label-class-name="my-label" :labelStyle="labelStyle">
            {{ form.forceMainAddress }}
          </el-descriptions-item>



          <el-descriptions-item label="机要地址" :span="1" label-class-name="my-label" :labelStyle="labelStyle">
            {{form.confidentialAddress}}
          </el-descriptions-item>

          <el-descriptions-item label="属性" label-class-name="my-label" :span="1" :labelStyle="labelStyle">
            <dict-tag :options="dict.type.yh_properties" :value="form.properties" style = "float:left;"/>
          </el-descriptions-item>

          <el-descriptions-item label="所属管辖类别" label-class-name="my-label" :span="1" :labelStyle="labelStyle">
            <dict-tag :options="dict.type.yh_category_of_jurisdiction" :value="form.categoryOfJurisdiction" style = "float:left;"/>
          </el-descriptions-item>

          <el-descriptions-item label="上市情况" label-class-name="my-label" :labelStyle="labelStyle">
            <dict-tag :options="dict.type.yh_listed_situation" :value="form.listedSituation" style = "float:left;"/>
          </el-descriptions-item>


          <el-descriptions-item label="BM等级" label-class-name="my-label" :span="1" :labelStyle="labelStyle">
            <dict-tag :options="dict.type.yh_security_grade" :value="form.securityGrade" style = "float:left;"/>
          </el-descriptions-item>

          <el-descriptions-item label="BM等级证书编号" label-class-name="my-label" :span="1" :labelStyle="labelStyle">
            {{ form.securityCertificateNo}}
          </el-descriptions-item>

          <el-descriptions-item label="承制资格" label-class-name="my-label" :span="1" :labelStyle="labelStyle">
            <dict-tag :options="dict.type.yh_grinders_qualification" :value="form.grindersQualification" style = "float:left;"/>
          </el-descriptions-item>

          <el-descriptions-item label="承制资格证书编号" label-class-name="my-label" :span="1" :labelStyle="labelStyle">
            {{ form.grindersQualificationNo}}
          </el-descriptions-item>
          <el-descriptions-item label="申办日期" label-class-name="my-label" :span="1" :labelStyle="labelStyle">
            {{ form.bidDate}}
          </el-descriptions-item>
          <el-descriptions-item label="续申日期" label-class-name="my-label" :span="1" :labelStyle="labelStyle">{{
            form.renewedDate}}
          </el-descriptions-item>
          <el-descriptions-item label="到期日期" label-class-name="my-label" :span="1" :labelStyle="labelStyle">
            {{ form.dateDue }}
          </el-descriptions-item>
          <el-descriptions-item label="成立时间" label-class-name="my-label" :span="1" :labelStyle="labelStyle">
            {{form.establishedTime }}
          </el-descriptions-item>

          <el-descriptions-item label="科研订货任务" label-class-name="my-label" :span="3" :labelStyle="labelStyle">
            {{form.researchOrderTask}}
          </el-descriptions-item>


          <el-descriptions-item label="企业简介" label-class-name="my-label" :span="3" :labelStyle="labelStyle">
            {{form.enterpriseProfile}}
          </el-descriptions-item>
          <!--          <el-descriptions-item label="领导" label-class-name="my-label" :span="3" :labelStyle="labelStyle">-->
          <!--            <div  v-for="(item,index) in form.leader">-->
          <!--              <p>领导{{index+1}}信息：</p>-->
          <!--              <p>领导姓名：{{item.leaderName}};&#12288;-->
          <!--                领导职务：{{item.leaderPosition}};&#12288;-->
          <!--              </p>-->
          <!--              <p>办公电话：{{item.leaderBusinessPhone}};&#12288;-->
          <!--                手机号码：{{item.leaderMobilePhone}}-->
          <!--              </p>-->
          <!--            </div>-->
          <!--          </el-descriptions-item>-->


        </el-descriptions>

        <!--        <div v-for="(item,index) in form.leader">-->
        <!--          <br/>-->
        <!--        <el-descriptions :title="'领导'+(index+1)" direction="vertical" :column="4" border>-->
        <!--          <el-descriptions-item label="领导姓名" :span="1">-->
        <!--              {{item.leaderName}}-->
        <!--          </el-descriptions-item>-->
        <!--          <el-descriptions-item label="领导职务" :span="1">-->
        <!--            {{item.leaderPosition}}-->
        <!--          </el-descriptions-item>-->
        <!--          <el-descriptions-item label="办公电话" :span="1">-->
        <!--            {{item.leaderBusinessPhone}}-->
        <!--          </el-descriptions-item>-->
        <!--          <el-descriptions-item label="手机号码" :span="1">-->
        <!--            {{item.leaderMobilePhone}}-->
        <!--          </el-descriptions-item>-->

        <!--        </el-descriptions>-->
        <!--        </div>-->

        <el-table :data="leader" border style="margin-top: 8px;">
          <!--          <el-table-column type="selection" width="55" align="center" />-->
          <!--          <el-table-column label="序号" align="center" prop="id" width="60"/>-->
          <el-table-column type="index" label="序号" width="55"  align="center" />
          <!--          <el-table-column label="用户ID" align="center" prop="userId" v-if="columns[0].visible"/>-->
          <el-table-column label="领导姓名" align="center" prop="leaderName" />



          <el-table-column label="领导职务" align="center" prop="leaderPosition" />
          <el-table-column label="办公电话" align="center" prop="leaderBusinessPhone" />
          <el-table-column label="办公电话" align="center" prop="leaderMobilePhone" />
          <el-table-column label="操作" align="center" >
            <template slot-scope="scope">
              <el-button
                size="mini"
                type="text"
                @click="handleDelete(scope.row)"
                v-hasPermi="['system:enterprise:remove']"
              >删除
              </el-button>
            </template>
          </el-table-column>



        </el-table>

        <!--        <el-table border style="width: 100%"  v-for="(item,index) in form.leader">-->
        <!--          <el-table-column-->
        <!--            label="姓名"-->
        <!--            width="180" >-->
        <!--            <template  slot-scope="scope">{{item[0].leaderName}}</template>-->
        <!--          </el-table-column>-->
        <!--            <el-table-column-->
        <!--              label="编码"-->
        <!--              width="180" >-->
        <!--              <template  slot-scope="scope">{{item.creditCodes}}</template>-->
        <!--            </el-table-column>-->
        <!--        </el-table>-->


        <!--        <el-table border style="width: 100%" v-for="(item,index) in form.leader" slot-scope="scope">-->
        <!--          <el-table-column-->
        <!--            label="姓名"-->
        <!--            width="180" >-->
        <!--            <template  >{{item[0].leaderName}}</template>-->
        <!--          </el-table-column>-->
        <!--          <el-table-column-->
        <!--            label="编码"-->
        <!--            width="180" >-->
        <!--            <template >{{item.creditCodes}}</template>-->
        <!--          </el-table-column>-->
        <!--        </el-table>-->

        <!--        <el-table  border height="550" style="width:100%" :data="tableData">-->
        <!--          <el-table-column  label="姓名">-->
        <!--            <template slot-scope="scope">-->
        <!--              {{leaderName}}-->
        <!--            </template>-->
        <!--          </el-table-column>-->
        <!--        </el-table>-->



      </el-form>



      <br/>
      <div style="float:right; margin-bottom: 15px;">

        <el-button @click="viewCancel">返 回</el-button>
      </div>
    </el-card>
  </div>
</template>
<style>
  .img-box1 {
    white-space: pre-wrap;
    width: 90%;

    position: center;
    margin:20px auto;
  }
  .img-box1 img {
    width: 70%;

    position: relative;
    left: 50%;
    transform: translateX(-50%);
  }
  .imgpre{
    width:200px;
    height: 100px;


  }
  .ifr{
    width: 70%;
    height: 700px;

    position: relative;
    left: 50%;
    transform: translateX(-50% );
  }


  .input_text input.el-input__inner {
    border: none
  }

  input:disabled{

    background-color: #F5F5F5;

    color:#F5F5F5;
  }

</style>
<script>


  import {
    listEnterprise,
    getEnterprise,
    getleader,
    delEnterprise,
    addEnterprise,
    updateEnterprise
  } from "@/api/module/ls/enterprise";

  import { getToken } from "@/utils/auth";

  // 导入省市区数据组件
  import { provinceAndCityData,CodeToText, TextToCode } from 'element-china-area-data'
  export default {
    name: "EnterpriseDetail",
    components: {

    },
    dicts: ['yh_security_grade',
      'yh_listed_situation',
      'yh_representative_office',
      'yh_menus',
      'yh_properties',
      'yh_category_of_jurisdiction',
      'yh_grinders_qualification'],

    data() {
      return {

        form:{
          departmentName: null,
          creditCodes: null,
          representativeOffice: null,
          menus: null,
          address: null,
          forceMainAddress: null,
          confidentialAddress: null,
          properties: null,
          categoryOfJurisdiction: null,
          listedSituation: null,
          securityGrade: null,
          securityCertificateNo: null,
          grindersQualification: null,
          grindersQualificationNo: null,
          bidDate: null,
          renewedDate: null,
          dateDue: null,
          establishedTime: null,
          enterpriseProfile: null,
          researchOrderTask: null,
          sequenceNumber: null,
          createBy: null,
          createTime: null,
          updateBy: null,
          updateTime: null,
          remark: null,
          note1: null,
          note2: null,
          note3: null,
          note4: null,
          note5: null,
          note6: null,
          note7: null,
          note8: null,
          note9: null,
          note10: null
        },
        // 选中选项卡的 name
        //activeName: "columnInfo",
        //label样式
        labelStyle: {'width': '140px', 'color': '#000000', 'text-align': 'right',},
        // 表格的高度
        tableHeight: document.documentElement.scrollHeight - 245 + "px",
        //城市选项
        options: provinceAndCityData,
        selectedOptions: [],
        // 表信息
        tables: [],
        leader:[],
        // 表列信息
        columns: [],
        // 字典信息
        dictOptions: [],
        // 菜单信息
        menus: [],
        // 表详细信息
        info: {note1:"",
          note2:""},
        // 查询参数
        queryParams: {
          pageNum: 1,
          pageSize: 10,
          title: undefined,
          operName: undefined,
          businessType: undefined,
          status: undefined
        }
      };
    },
    created() {
      this.getList();
      const id = this.$route.query.id;
      if (id) {
        // 获取表详细信息
        getEnterprise(id).then(res => {
          this.form = res.data;
          //console.log(this.form+"89")

        });

      }

    },
    methods: {
      getList() {
        this.loading = true;
        const id = this.$route.query.id
        console.log(id+"plp")
        getleader(id).then(response => {
          this.leader = response.rows;
          // console.log(this.leader)
          this.total = response.total;
          this.loading = false;
        });
      },
      /** 删除按钮操作 */
      handleDelete(row) {
        const ids = row.id || this.ids;
        this.$modal.confirm('是否确认删除领导信息编号为"' + ids + '"的数据项？').then(function () {
          return delLeader(ids);
        }).then(() => {
          this.getList();
          this.$modal.msgSuccess("删除成功");
        }).catch(() => {
        });
      },
      /** 关闭按钮 */
      viewCancel() {
        const id = this.$route.query.id;
        getEnterprise(id).then(response => {
          this.form = response.data;

        });
        const obj = { path: "/jiben/lsenterprise", query: {id} };
        this.$tab.closeOpenPage(obj);
      }
    },

  };
</script>






